home *** CD-ROM | disk | FTP | other *** search
- // Scene File: TEXTURE.PI
- // Author: Rob McGregor
-
- // A sphere changes from dull red to reflective blue and back again
-
- include "..\..\..\colors.inc"
-
- // Set up the camera
- viewpoint {
- from <3, 0, -10>
- at <0, 0, 0>
- up <0, 1, 0>
- angle 45
- resolution 320, 200
- aspect 1.6
- }
-
- background grey
- haze 0.98, 20, grey
-
- // Lights
- light <-5, 5, -20>
- light <5, 5, -20>
-
- // Define the range of animation
- start_frame 0
- end_frame 199
- outfile "tex"
-
- // Interpolate the proper texture shift
- if (frame <= end_frame / 2) {
- define ch (frame - start_frame) / ((end_frame / 2) - start_frame)
- define r (1 - ch)^2 * 1 + (ch^2) * 0 + 2 * ch * (1 - ch) * 0.5
- define b (1 - ch)^2 * 0 + (ch^2) * 1 + 2 * ch * (1 - ch) * 0.5
- }
- else {
- define ch (frame - (end_frame / 2)) / (end_frame - (end_frame / 2))
- define r (1 - ch)^2 * 0 + (ch^2) * 1 + 2 * ch * (1 - ch) * 0.5
- define b (1 - ch)^2 * 1 + (ch^2) * 0 + 2 * ch * (1 - ch) * 0.5
- }
-
- define g 0
- define val b / 1.5
-
- // Create the animated texture
- define sphere_tex
- texture {
- surface {
- color <r, g, b>
- ambient 0.25
- diffuse 0.7
- specular white, val
- microfacet Phong 5
- reflection white, val / 1.75
- }
- }
-
- // Define the sphere
- object { sphere <0, 0, 0>, 2 sphere_tex }
-
- // Give the sphere something to reflect
- object {
- disc <0, 0, 0>, <0, 1, 0>, 10000
- texture {
- hexagon reflective_brown, reflective_tan, reflective_white
- scale <1.5, 1, 1.5>
- }
- rotate <0, 40, 0>
- translate <0, -2, 0>
- }
-
-
-